import { JsonApiService } from 'src/app/api/JsonApi.service';
import { ValidatorService } from 'src/app/api/validator.service';
import { SchemaService } from './Schema.service';
export class LoginService {
  private jsonApiService: JsonApiService;
  private validatorService: ValidatorService;
  private schema: SchemaService;
  constructor() {
    this.jsonApiService = new JsonApiService();
    this.validatorService = new ValidatorService();
    this.schema = new SchemaService();
  }
  testGet(data) {
    return this.validatorService.validate(
      this.jsonApiService.checkGet(`/get`, data),
      this.schema,
      data,
      this.schema.checkPaths(['id'])
    )
  }
  notRes() {
    return this.jsonApiService.post(`/notRes`)
  }
  navigation(data): Promise<any> {
    return this.validatorService.validate(
      this.jsonApiService.checkPost(`/blog/config/navigation`, data, 'blog'),
      this.schema,
      data
    )
  }
}